package org.particlethink.config;

import org.particlethink.service.StorageService;
import org.particlethink.service.impl.MinioStorage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MinioStorageConfigBean {

	@Bean
	public StorageService minioStorageService(MinioStorageConfigProperties minioStorageConfigProperties) {
		return new MinioStorage(
				minioStorageConfigProperties.getEndpoint(),
				minioStorageConfigProperties.getAccessKey(),
				minioStorageConfigProperties.getSecretKey(),
				minioStorageConfigProperties.getBucket()
		);
	}
}
